<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" src="https://userimg.qunarzz.com/imgs/202203/26/C.SpJXFbOVdpjVrxO1O720.webp" alt="">
      <div class="banner-info">
        <div class="banner-tittle">大连圣亚海洋世界(AAAA景区)</div>
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe8d3;</span>
          39
        </div>
      </div>
    </div>
    <common-gallary :imgs="imgs" v-show="showGallary" @close="handleGallaryClick"></common-gallary>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
export default {
  name: 'DetailBanner',
  data () {
    return {
      showGallary: false,
      imgs: [
        'https://userimg.qunarzz.com/imgs/202203/26/C.SpJXFbOVdpjVrxO1O720.webp',
        'https://userimg.qunarzz.com/imgs/201910/19/C.3gwQHIx8gjLdw4h6C720.webp'
      ]
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClick () {
      this.showGallary = false
    }
  },
  components: {
    CommonGallary
  }
}
</script>

<style scoped lang="stylus">
.banner {
  position:relative
  overflow:hidden
  height:0
  padding-bottom:50%
}
  .banner-img {
    width:100%
  }
  .banner-info {
    display:flex
    position:absolute
    left:0
    right:0
    bottom:0
    line-height:1.2rem
    color: #fff
    background-image: linear-gradient(top, rgba(0 0 0 0), rgba(0 0 0 .5))// 渐变色
  }
  .banner-tittle {
    flex:1
    padding:0 0 .2rem .2rem
  }
  .banner-number {
    padding:0 .5rem
    height:1rem
    line-height:1rem
    border-radius:.3rem
    background: rgba(0 0 0 .5)
    font-size:.24rem
  }
  .banner-icon {
    font-size:.24rem
  }
</style>
